Passing Data Between Tasks
In this section you will add another task to your automation and pass variable data to it.
Prepare the Canvas
Let's prepare the workflow canvas by adding another task.
Go back to the Automation Studio tab.
- If you closed the application tab, simply go to the IAP home screen and click the "Automation Studio" tile.
- Select Find an Automation and search for the "EnlightenMe" automation you created previously.
Click the green transition line between the FetchFact and End tasks.
Either press the "delete" button on your keyboard, or click the trashcan icon in the upper-right corner of the canvas to delete the green transition line.
In the Task Menu Sidebar, search for "Query" and add it to your canvas.
Add a transition between the FetchFact and Query tasks, and then add another between the Query and End tasks.
You should now have four different (yet connected) tasks on your canvas:
START
FetchFact
Query
END
Figure 1. Add Query Task
Configure the Query Task
Next, let's configure the variable information.
Double-click the Query task to open the configuration window for it.
Change the Summary field to read "IsolateFact".
Change the Description field to read "Just give me the fact".
For this example, set the Reference variable for pass_on_null to
False
. This tells the automation to "fail" the task in Job Manager if no value is provided.Set the query Reference variable to
value.joke
.- For this step, go back to the Job Manager tab you left open. Refer to the
response
variable in the OUTGOING tab of the Task History. The response was provided in the form of a JSON object. - In the JASONPath syntax of the
response
, find wherevalue.joke
exists as a key-value pair.
Note: For more information on JSONPath syntax, we recommend reading JSONPath-XPath for JSON. We also recommend the JSONPath Online Evaluator when experimenting with JSONPath data extraction.
- For this step, go back to the Job Manager tab you left open. Refer to the
Change the obj Reference task from "static" to
FetchFact
and accept the defaultresponse
that displays. This indicates the data you want to search through will be provided by FetchFact.Click SAVE (lower-left corner) to close the Query task configuration window.
Click SAVE on the workflow canvas to save the entire automation.
Hover over the Query task to show the tooltip "Just give me the fact".
Run the Automation
To test run the automation:
Go to the upper-left corner of the canvas, click the blue play arrow to the right of the Automation Name. A modal window will open.
Click the START button in the left corner of the modal. A green toast banner will pop-up at the bottom of the screen.
Click the message link that says CLICK TO VIEW JOB.
The Job Manager tab opens in your browser and shows the status of the automation you just executed. This time, two tasks are displayed:
IsolateFact
FetchFact
Figure 2. Job Manager Details
Click the book icon at the end of the IsolateFact task.
The Outgoing tab in the Task History reveals the value of the
return_data
variable, indicating that you successfully isolated the incoming fact from the data that was returned by the Query task.Figure 3. Outgoing Task History
Summary Wrap-Up
Congratulations on completing this segment of the tour! By now, you should know how to:
- Build an automation.
- Pass variable data between tasks in an automation.
- Use the Query task to isolate values from objects.
In the next section, you will learn how to customize the input values.